<div id="page-heading"><h1><?php echo lang('file_folders.manage_title'); ?></h1></div>
<?php $this->load->view('partials/notices'); ?>
<?php if ($file_folders): ?>
<?php echo form_open('admin/folders/action', 'id="mainform"');?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" id="product-table">
				<tbody>
				<tr>
				<?php if (group_has_role('folders', 'delete')): ?>
					<th class="table-header-check"><a id="toggle-all" ></a> </th>
				<?php endif; ?>
					<th class="table-header-repeat line-left"><a href="javascript:void(0);"><?php echo lang('files.name_label'); ?></a></th>
					<th class="table-header-repeat line-left"><a href="javascript:void(0);"><?php echo lang('file_folders.slug_label'); ?></a></th>
					<th class="table-header-repeat line-left"><a href="javascript:void(0);"><?php echo lang('file_folders.created_label'); ?></a></th>
					<th class="table-header-repeat line-left"><a href="javascript:void(0);"><?php echo lang('global:actions')?></a></th>
				</tr>
				<?php foreach ($file_folders as $key => $folder): ?>
				<tr <?php if($key%2 == 0):?>class="alternate-row"<?php endif;?>>
					<?php if (group_has_role('folders', 'delete')): ?>
						<td><?php echo form_checkbox('action_to[]', $folder->id); ?></td>
					<?php endif; ?>
					<td><?php echo anchor('admin/folders/contents/' . $folder->id, repeater('&raquo; ', $folder->depth) . $folder->name, 'title="' . $folder->name .'" data-path="' . $folder->virtual_path . '" class="folder-hash"'); ?></td>
					<td><?php echo $folder->slug; ?></td>
					<td><?php echo format_date($folder->date_added); ?></td>
					<td class="options-width">
					<?php if (group_has_role('folders', 'edit')): ?>
						<?php echo anchor('admin/folders/edit/' . $folder->id, ' ', 'title="'. lang('buttons.edit').'" class="icon-1 info-tooltip"'); ?>
						<?php endif; ?>
						<?php if (group_has_role('folders', 'delete')): ?>
						<?php echo anchor('admin/folders/delete/' . $folder->id, ' ', 'title="'. lang('buttons.delete').'" class="icon-2 info-tooltip"'); ?>
						<?php endif; ?>
					</td>
				</tr>
				<?php endforeach;?>
				</tbody>
</table>
<input type="hidden" name="btnAction"  id="btnAction" value=""/>
<?php if (group_has_role('folders', 'delete')): ?>
<script type="text/javascript">
	function submit_form(type)
	{
		if('delete' == type){
			if(confirm('<?php echo lang("global:delete_confirm")?>')){
				$('#btnAction').val('delete');
				$('#mainform').submit();
			}
		}
	}
</script>
<div id="actions-box">
	<a href="" class="action-slider"></a>
	<div id="actions-box-slider">
		<a href="javascript:void(0);" onclick="submit_form('delete');" class="action-delete">Delete</a>
	</div>
	<div class="clear"></div>
</div>
<div align=center><div class="inner"><?php $this->load->view('partials/pagination'); ?></div></div>
<?php endif; ?>
<?php echo form_close();?>

<?php else: ?>
	<div class="no_data file-folders">
		<p><?php echo lang('file_folders.no_folders');?></p>
		<br />
		<br />
		<p>[<?php echo anchor('admin/folders/create', lang('files.upload_label'), 'class="button folder-create"'); ?>]</p>
	</div>
<?php endif; ?>